/**
 * @description: 格式化毫秒数
 * @param {number} millis
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function formatDuration(millis: number) {
    if (millis < 1000) {
      return `${millis}毫秒`;
    }
  
    const seconds = Math.floor(millis / 1000);
    if (seconds < 60) {
      return `${seconds}秒`;
    }
  
    const minutes = Math.floor(seconds / 60);
    const remainingSeconds = seconds % 60;
    if (minutes < 60) {
      return `${minutes}分${remainingSeconds}秒`;
    }
  
    const hours = Math.floor(minutes / 60);
    const remainingMinutes = minutes % 60;
    if (hours < 24) {
      return `${hours}小时${remainingMinutes}分${remainingSeconds}秒`;
    }
  
    const days = Math.floor(hours / 24);
    const remainingHours = hours % 24;
    return `${days}天${remainingHours}小时${remainingMinutes}分${remainingSeconds}秒`;
  }